<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //宏任务结束后先执行微任务
        setTimeout(() => {
            console.log(1);
            new Promise(function (resolve) {
                console.log('executor');
                resolve(3);
            }).then(data => console.log(data))
        }, 0);
        setTimeout(() => {
            console.log(2);
        }, 0);
        //132
    </script>
</body>

</html>